# -*- coding: utf-8 -*-

from django.urls import path, re_path
from rest_framework import routers

from dvadmin.system.views.dept import DeptViewSet
from dvadmin.system.views.devicetypes import DeviceTypesViewSet
from dvadmin.system.views.menu import MenuViewSet
from dvadmin.system.views.operation_log import OperationLogViewSet
from dvadmin.system.views.persion_info import PersionInfoViewSet
from dvadmin.system.views.roadsinfos import RoadsinfosViewSet
from dvadmin.system.views.role import RoleViewSet
from dvadmin.system.views.structures import StructuresViewSet
from dvadmin.system.views.sys_log import SysLogViewSet
from dvadmin.system.views.systypes import SysTypesViewSet
from dvadmin.system.views.user import UserViewSet
from dvadmin.system.views.sysdict import SysDictViewSet
system_url = routers.DefaultRouter()
system_url.register(r'role', RoleViewSet)
system_url.register(r'dept', DeptViewSet)
system_url.register(r'user', UserViewSet)
# system_url.register(r'operation_log', OperationLogViewSet)
system_url.register(r'sys_dict', SysDictViewSet)
system_url.register(r'sys_log', SysLogViewSet)
system_url.register(r'sys_type', SysTypesViewSet)
system_url.register(r'device_type', DeviceTypesViewSet)
system_url.register(r'roads_info', RoadsinfosViewSet)
system_url.register(r'structures', StructuresViewSet)
system_url.register(r'menu', MenuViewSet)
system_url.register(r'persion', PersionInfoViewSet)
urlpatterns = [
    # path('role/role_id_to_menu/<str:pk>/', RoleViewSet.as_view({'get': 'roleId_to_menu'})),
    path('menu/user/', MenuViewSet.as_view({'get': 'web_router'})),
    path('roads_info/user/', RoadsinfosViewSet.as_view({'get': 'get_user_roadinfo'})),
    path('structures/user/', StructuresViewSet.as_view({'get': 'get_user_structures'})),
    path('user/user_info/', UserViewSet.as_view({'get': 'user_info', 'put': 'update_user_info'})),
    path('user/change_password/<str:pk>/', UserViewSet.as_view({'put': 'change_password'})),
    path('user/password_reset/<str:pk>/', UserViewSet.as_view({'put': 'password_reset'})),
    path('sys_dict/set_dict_enable/<str:pk>/', SysDictViewSet.as_view({'put': 'set_dict_enable'})),
]
urlpatterns += system_url.urls
